package com.wise.site.adapter;

import com.wise.site.R;

import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.TextView;

/**
 * 关键字列表
 * @author Administrator
 *
 */
public class KeywordAdapter extends ArrayListAdapter<String> {
	private OnClickListener mOnClickListener;
	

	public void setOnClickListener(OnClickListener onClickListener) {
		this.mOnClickListener = onClickListener;
	}

	public KeywordAdapter(Context context) {
		super(context);
	}
	
	

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if(convertView == null){
			convertView = inflater.inflate(R.layout.list_item_history, null);
			if(mOnClickListener != null){
				convertView.findViewById(R.id.tab_del).setOnClickListener(mOnClickListener);
				convertView.setOnClickListener(mOnClickListener);
			}
		}
		
		((TextView)convertView.findViewById(R.id.tab_tx)).setText(mList.get(position));
		convertView.findViewById(R.id.tab_del).setTag(mList.get(position));
		
		return convertView;
	}

	@Override
	public void moveToNextPage() {
		
	}

	@Override
	public void moveToFristPage() {
		
	}

}
